Optimal. Leaf size=145 \[ -\frac {2 i d^2 \text {Li}_2\left (-i e^{i (a+b x)}\right )}{b^3}+\frac {2 i d^2 \text {Li}_2\left (i e^{i (a+b x)}\right )}{b^3}-\frac {2 d^2 \cos (a+b x)}{b^3}-\frac {2 d (c+d x) \sin (a+b x)}{b^2}+\frac {4 i d (c+d x) \tan ^{-1}\left (e^{i (a+b x)}\right )}{b^2}+\frac {(c+d x)^2 \cos (a+b x)}{b}+\frac {(c+d x)^2 \sec (a+b x)}{b} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.13, antiderivative size = 145, normalized size of antiderivative = 1.00, number of steps used = 10, number of rules used = 7, integrand size = 22, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.318, Rules used = {4407, 3296, 2638, 4409, 4181, 2279, 2391} \[ -\frac {2 i d^2 \text {PolyLog}\left (2,-i e^{i (a+b x)}\right )}{b^3}+\frac {2 i d^2 \text {PolyLog}\left (2,i e^{i (a+b x)}\right )}{b^3}-\frac {2 d (c+d x) \sin (a+b x)}{b^2}+\frac {4 i d (c+d x) \tan ^{-1}\left (e^{i (a+b x)}\right )}{b^2}-\frac {2 d^2 \cos (a+b x)}{b^3}+\frac {(c+d x)^2 \cos (a+b x)}{b}+\frac {(c+d x)^2 \sec (a+b x)}{b} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 2279
Rule 2391
Rule 2638
Rule 3296
Rule 4181
Rule 4407
Rule 4409
Rubi steps
\begin {align*} \int (c+d x)^2 \sin (a+b x) \tan ^2(a+b x) \, dx &=-\int (c+d x)^2 \sin (a+b x) \, dx+\int (c+d x)^2 \sec (a+b x) \tan (a+b x) \, dx\\ &=\frac {(c+d x)^2 \cos (a+b x)}{b}+\frac {(c+d x)^2 \sec (a+b x)}{b}-\frac {(2 d) \int (c+d x) \cos (a+b x) \, dx}{b}-\frac {(2 d) \int (c+d x) \sec (a+b x) \, dx}{b}\\ &=\frac {4 i d (c+d x) \tan ^{-1}\left (e^{i (a+b x)}\right )}{b^2}+\frac {(c+d x)^2 \cos (a+b x)}{b}+\frac {(c+d x)^2 \sec (a+b x)}{b}-\frac {2 d (c+d x) \sin (a+b x)}{b^2}+\frac {\left (2 d^2\right ) \int \log \left (1-i e^{i (a+b x)}\right ) \, dx}{b^2}-\frac {\left (2 d^2\right ) \int \log \left (1+i e^{i (a+b x)}\right ) \, dx}{b^2}+\frac {\left (2 d^2\right ) \int \sin (a+b x) \, dx}{b^2}\\ &=\frac {4 i d (c+d x) \tan ^{-1}\left (e^{i (a+b x)}\right )}{b^2}-\frac {2 d^2 \cos (a+b x)}{b^3}+\frac {(c+d x)^2 \cos (a+b x)}{b}+\frac {(c+d x)^2 \sec (a+b x)}{b}-\frac {2 d (c+d x) \sin (a+b x)}{b^2}-\frac {\left (2 i d^2\right ) \operatorname {Subst}\left (\int \frac {\log (1-i x)}{x} \, dx,x,e^{i (a+b x)}\right )}{b^3}+\frac {\left (2 i d^2\right ) \operatorname {Subst}\left (\int \frac {\log (1+i x)}{x} \, dx,x,e^{i (a+b x)}\right )}{b^3}\\ &=\frac {4 i d (c+d x) \tan ^{-1}\left (e^{i (a+b x)}\right )}{b^2}-\frac {2 d^2 \cos (a+b x)}{b^3}+\frac {(c+d x)^2 \cos (a+b x)}{b}-\frac {2 i d^2 \text {Li}_2\left (-i e^{i (a+b x)}\right )}{b^3}+\frac {2 i d^2 \text {Li}_2\left (i e^{i (a+b x)}\right )}{b^3}+\frac {(c+d x)^2 \sec (a+b x)}{b}-\frac {2 d (c+d x) \sin (a+b x)}{b^2}\\ \end {align*}
________________________________________________________________________________________
Mathematica [B] time = 3.12, size = 362, normalized size = 2.50 \[ \frac {\cos (b x) \left (\cos (a) \left (b^2 (c+d x)^2-2 d^2\right )-2 b d \sin (a) (c+d x)\right )-\sin (b x) \left (\sin (a) \left (b^2 (c+d x)^2-2 d^2\right )+2 b d \cos (a) (c+d x)\right )+b^2 \sec (a) (c+d x)^2+\frac {b^2 \sin \left (\frac {b x}{2}\right ) (c+d x)^2}{\left (\cos \left (\frac {a}{2}\right )-\sin \left (\frac {a}{2}\right )\right ) \left (\cos \left (\frac {1}{2} (a+b x)\right )-\sin \left (\frac {1}{2} (a+b x)\right )\right )}-\frac {b^2 \sin \left (\frac {b x}{2}\right ) (c+d x)^2}{\left (\sin \left (\frac {a}{2}\right )+\cos \left (\frac {a}{2}\right )\right ) \left (\sin \left (\frac {1}{2} (a+b x)\right )+\cos \left (\frac {1}{2} (a+b x)\right )\right )}-4 b c d \tanh ^{-1}\left (\cos (a) \tan \left (\frac {b x}{2}\right )+\sin (a)\right )+\frac {2 d^2 \csc (a) \left (i \text {Li}_2\left (-e^{i \left (b x-\tan ^{-1}(\cot (a))\right )}\right )-i \text {Li}_2\left (e^{i \left (b x-\tan ^{-1}(\cot (a))\right )}\right )+\left (b x-\tan ^{-1}(\cot (a))\right ) \left (\log \left (1-e^{i \left (b x-\tan ^{-1}(\cot (a))\right )}\right )-\log \left (1+e^{i \left (b x-\tan ^{-1}(\cot (a))\right )}\right )\right )\right )}{\sqrt {\csc ^2(a)}}-4 d^2 \tan ^{-1}(\cot (a)) \tanh ^{-1}\left (\cos (a) \tan \left (\frac {b x}{2}\right )+\sin (a)\right )}{b^3} \]
Warning: Unable to verify antiderivative.
[In]
[Out]
________________________________________________________________________________________
fricas [B] time = 0.53, size = 511, normalized size = 3.52 \[ \frac {b^{2} d^{2} x^{2} + 2 \, b^{2} c d x + b^{2} c^{2} + i \, d^{2} \cos \left (b x + a\right ) {\rm Li}_2\left (i \, \cos \left (b x + a\right ) + \sin \left (b x + a\right )\right ) + i \, d^{2} \cos \left (b x + a\right ) {\rm Li}_2\left (i \, \cos \left (b x + a\right ) - \sin \left (b x + a\right )\right ) - i \, d^{2} \cos \left (b x + a\right ) {\rm Li}_2\left (-i \, \cos \left (b x + a\right ) + \sin \left (b x + a\right )\right ) - i \, d^{2} \cos \left (b x + a\right ) {\rm Li}_2\left (-i \, \cos \left (b x + a\right ) - \sin \left (b x + a\right )\right ) + {\left (b^{2} d^{2} x^{2} + 2 \, b^{2} c d x + b^{2} c^{2} - 2 \, d^{2}\right )} \cos \left (b x + a\right )^{2} - {\left (b c d - a d^{2}\right )} \cos \left (b x + a\right ) \log \left (\cos \left (b x + a\right ) + i \, \sin \left (b x + a\right ) + i\right ) + {\left (b c d - a d^{2}\right )} \cos \left (b x + a\right ) \log \left (\cos \left (b x + a\right ) - i \, \sin \left (b x + a\right ) + i\right ) - {\left (b d^{2} x + a d^{2}\right )} \cos \left (b x + a\right ) \log \left (i \, \cos \left (b x + a\right ) + \sin \left (b x + a\right ) + 1\right ) + {\left (b d^{2} x + a d^{2}\right )} \cos \left (b x + a\right ) \log \left (i \, \cos \left (b x + a\right ) - \sin \left (b x + a\right ) + 1\right ) - {\left (b d^{2} x + a d^{2}\right )} \cos \left (b x + a\right ) \log \left (-i \, \cos \left (b x + a\right ) + \sin \left (b x + a\right ) + 1\right ) + {\left (b d^{2} x + a d^{2}\right )} \cos \left (b x + a\right ) \log \left (-i \, \cos \left (b x + a\right ) - \sin \left (b x + a\right ) + 1\right ) - {\left (b c d - a d^{2}\right )} \cos \left (b x + a\right ) \log \left (-\cos \left (b x + a\right ) + i \, \sin \left (b x + a\right ) + i\right ) + {\left (b c d - a d^{2}\right )} \cos \left (b x + a\right ) \log \left (-\cos \left (b x + a\right ) - i \, \sin \left (b x + a\right ) + i\right ) - 2 \, {\left (b d^{2} x + b c d\right )} \cos \left (b x + a\right ) \sin \left (b x + a\right )}{b^{3} \cos \left (b x + a\right )} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [F] time = 0.00, size = 0, normalized size = 0.00 \[ \int {\left (d x + c\right )}^{2} \sin \left (b x + a\right ) \tan \left (b x + a\right )^{2}\,{d x} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [B] time = 0.13, size = 345, normalized size = 2.38 \[ \frac {\left (d^{2} x^{2} b^{2}+2 b^{2} c d x +2 i b \,d^{2} x +b^{2} c^{2}+2 i b c d -2 d^{2}\right ) {\mathrm e}^{i \left (b x +a \right )}}{2 b^{3}}+\frac {\left (d^{2} x^{2} b^{2}+2 b^{2} c d x -2 i b \,d^{2} x +b^{2} c^{2}-2 i b c d -2 d^{2}\right ) {\mathrm e}^{-i \left (b x +a \right )}}{2 b^{3}}+\frac {2 \,{\mathrm e}^{i \left (b x +a \right )} \left (d^{2} x^{2}+2 c d x +c^{2}\right )}{b \left (1+{\mathrm e}^{2 i \left (b x +a \right )}\right )}+\frac {4 i d c \arctan \left ({\mathrm e}^{i \left (b x +a \right )}\right )}{b^{2}}+\frac {2 d^{2} \ln \left (1+i {\mathrm e}^{i \left (b x +a \right )}\right ) x}{b^{2}}+\frac {2 d^{2} \ln \left (1+i {\mathrm e}^{i \left (b x +a \right )}\right ) a}{b^{3}}-\frac {2 d^{2} \ln \left (1-i {\mathrm e}^{i \left (b x +a \right )}\right ) x}{b^{2}}-\frac {2 d^{2} \ln \left (1-i {\mathrm e}^{i \left (b x +a \right )}\right ) a}{b^{3}}-\frac {2 i d^{2} \dilog \left (1+i {\mathrm e}^{i \left (b x +a \right )}\right )}{b^{3}}+\frac {2 i d^{2} \dilog \left (1-i {\mathrm e}^{i \left (b x +a \right )}\right )}{b^{3}}-\frac {4 i d^{2} a \arctan \left ({\mathrm e}^{i \left (b x +a \right )}\right )}{b^{3}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [F(-1)] time = 0.00, size = 0, normalized size = 0.00 \[ \text {Timed out} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [F] time = 0.00, size = -1, normalized size = -0.01 \[ \int \sin \left (a+b\,x\right )\,{\mathrm {tan}\left (a+b\,x\right )}^2\,{\left (c+d\,x\right )}^2 \,d x \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [F] time = 0.00, size = 0, normalized size = 0.00 \[ \int \left (c + d x\right )^{2} \sin {\left (a + b x \right )} \tan ^{2}{\left (a + b x \right )}\, dx \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________